#ifndef PHYSICS_OBJECT_H
#define PHYSICS_OBJECT_H

#include "Vec3.h"
#include "GameObject.h"
#include "SteeringOutput.h"

namespace Engine
{
	class PhysicsObject : public GameObject
	{
		protected:
			float m_maxSpeed;
			float m_maxSpeedSquared;
			float m_maxAngularAcc;
			float m_maxAngularVel;
			float m_maxAcc;
			float m_maxAccSquared;

			Vec3 m_pos, m_scale, m_vel;
			float m_rot;

			SteeringOutput m_steeringOutput;

		public:
			virtual ~PhysicsObject() = 0 {}

			PhysicsObject();

			void SetMaxSpeed(float s) {m_maxSpeed = s; m_maxSpeedSquared = s * s;}
			void SetMaxAngularAcc(float a) {m_maxAngularAcc = a;}
			void SetMaxAngularVel(float v) {m_maxAngularVel = v;}
			void SetMaxAcc(float a) {m_maxAcc = a;}
			void SetPos(const Vec3& p) {m_pos = p;}
			void SetScale(const Vec3& s) {m_scale = s;}
			void SetRot(float r) {m_rot = r;}
			void SetVel(const Vec3& v) {m_vel = v;}

			float GetMaxSpeed() const {return m_maxSpeed;}
			float GetMaxSpeedSquared() const {return m_maxSpeedSquared;}
			float GetMaxAngularAcc() const {return m_maxAngularAcc;}
			float GetMaxAngularVel() const {return m_maxAngularVel;}
			float GetMaxAcc() const {return m_maxAcc;}
			const Vec3& GetPos() const {return m_pos;}
			const Vec3& GetScale() const {return m_scale;}
			const Vec3& GetVel() const {return m_vel;}
			float GetSpeed() const {return m_vel.Length();}
			float GetRot() const {return m_rot;}
			float GetSpeedSquared() const {return m_vel.SquaredLength();}

			//inherited from GameObject
			virtual void Update() override;
	};
}

#endif